<?php

namespace app\payment;

use app\services\PropertyService;
use plugin\admin\app\model\UserPropertyLog;

class RrPay extends AbstractPay
{
    public function pay()
    {
        PropertyService::reduce($this->data['order']['user_id'], PayFactory::REGISTER_INTEGRAL, $this->data['order']['register_integral'], UserPropertyLog::REGISTER_INTEGRAL_ORDER_PAY, '', $this->data['order_no']);
        PropertyService::reduce($this->data['order']['user_id'], PayFactory::RECHARGE_INTEGRAL, $this->data['order']['recharge_integral'], UserPropertyLog::RECHARGE_INTEGRAL_ORDER_PAY, '', $this->data['order_no']);
    }

    public function payBack()
    {
        PropertyService::add($this->data['order']['user_id'], PayFactory::REGISTER_INTEGRAL, $this->data['order']['register_integral'], UserPropertyLog::REGISTER_INTEGRAL_ORDER_PAY, '', $this->data['order_no']);
        PropertyService::add($this->data['order']['user_id'], PayFactory::RECHARGE_INTEGRAL, $this->data['order']['recharge_integral'], UserPropertyLog::RECHARGE_INTEGRAL_ORDER_PAY, '', $this->data['order_no']);
    }
}